<?php

declare(strict_types=1);
/*
 * This file is part of Leonsw.
 *
 * @link     https://leonsw.com
 * @document https://docs.leonsw.com
 * @contact  leonsw.com@gmail.com
 * @license  https://leonsw.com/LICENSE
 */
namespace App\Resource\Lottery2\Balance;


use Illuminate\Http\Resources\Json\JsonResource;

class UserResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'head_picture' => $this->user_data->head_picture ?? '',
            'nickname'     => $this->user_data->nickname ?? '',
            'coin'         => $this->money ?? 0,
            'balance'      => $this->gashapon->balance ?? 0,
            'level'        => $this->gashapon->level ?? 0,
            'exp'          => $this->gashapon->exp ?? 0,
            'next_level'   => $this->gashapon->nextLevel ?? 0,
            'next_exp'     => $this->gashapon->nextExp ?? 0,
            'count'        => $this->gashapon->count ?? 0,
        ];
    }
}
